package com.ruoyi.questionnaire.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.questionnaire.domain.QuestionnaireAnswerDetail;
import com.ruoyi.questionnaire.service.IQuestionnaireAnswerDetailService;

@RestController
@RequestMapping("/questionnaire/answerDetail")
public class QuestionnaireAnswerDetailController {
    @Autowired
    private IQuestionnaireAnswerDetailService answerDetailService;

    // 查询答卷明细列表
    @GetMapping("/list")
    public List<QuestionnaireAnswerDetail> list(@RequestParam Long answerId) {
        return answerDetailService.selectAnswerDetailList(answerId);
    }

    // 批量新增答卷明细
    @PostMapping("/batch")
    public int addBatch(@RequestBody List<QuestionnaireAnswerDetail> details) {
        return answerDetailService.insertAnswerDetailBatch(details);
    }
} 